package com.jiang.admin.core.jobbean;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.jiang.admin.core.trigger.JobTriggerPoolHelper;

/**
 * 远程调用job bean
 * @author jiangyougan
 *
 */
public class RibbonJobBean extends QuartzJobBean {
	
	private static Logger logger = LoggerFactory.getLogger(RibbonJobBean.class);

	@Override
	protected void executeInternal(JobExecutionContext context)
			throws JobExecutionException {
		// load jobId
		JobKey jobKey = context.getTrigger().getJobKey();
		Integer jobId = Integer.valueOf(jobKey.getName());
		// trigger
		JobTriggerPoolHelper.trigger(jobId, null);
		
		logger.info(">>>>>>>>>>>>>>>>>> RibbonJobBean jobId=" + jobId +" executeInternal");
	}

}